package com.itheima.config;

import com.itheima.interceptor.LoginCheckInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration//首先要声明这是一个  “配置类”
public class WebConfig implements WebMvcConfigurer {//接入这个接口
    @Autowired
    private LoginCheckInterceptor loginCheckInterceptor0;

    public void addLoginCheckInterceptor0(InterceptorRegistry registry) {
        registry.addInterceptor(loginCheckInterceptor0).addPathPatterns("/**").excludePathPatterns("/login");
    }
}
